home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 27.zip
/
BS1 part 27
/
VisionaleV1.1-D1.adf
/
virx
/
HorizontalWave.virx
< prev
next >
Wrap
Text File
|
1992-10-30
|
2KB
|
93 lines
/*
* HorizontalWave.virx
* Copyright (c)1992 Bruno Costa & Lucia Darsa
*/
options results
signal on HALT
signal on SYNTAX
signal on FAILURE
call openmath
lockgui
form = '"BOOL,_TO Window,0|' ||,
'BOOL,Just _Selected Vertices,0|'||,
'STR,_Amplitude:,5.0,6|' ||,
'STR,Number of _Waves:,3,6"'
requestform TITLE '"Horizontal Wave"' form
if rc >= 5 then
signal HALT
parse var result window '|' selected '|' amplitude '|' nwaves
if window = 0 then
winname = 'FROM'
else
winname = 'TO'
getdensity
parse var result nrows ncols
if selected = 1 then
getmesh winname 'SELECTED'
else
getmesh winname
parse var result width height inmesh
pi = 3.14159
k = (2 * pi) / (height / nwaves)
outmesh = ''
sel = 1
do row = 1 to nrows
do col = 1 to ncols
if selected = 1 then
parse var inmesh inx iny sel inmesh
else
parse var inmesh inx iny inmesh
outy = iny
if sel & col > 1 & col < ncols then
outx = inx + amplitude * sin(k * iny)
else
outx = inx
outmesh = outmesh outx outy
end
end
setmesh winname '"'outmesh'"'
unlockgui
exit 0
/* add rexxmathlib.library if it is not already open */
openmath: procedure
if ~show('L', "rexxmathlib.library") then do
if ~addlib("rexxmathlib.library", 0, -30, 0) then do
requestnotify "could not open rexxmathlib.library"
exit 20
end
end
return
BREAK_C:
HALT:
unlockgui
exit 20
FAILURE:
requestnotify '"Host *"'address()'*" returned an error (severity 'rc')*nexecuting' compress(sourceline(2),'* ') 'at line' SIGL'"'
unlockgui
exit 20
SYNTAX:
requestnotify '"'errortext(rc)'*nexecuting' compress(sourceline(2),'* ') 'at line' SIGL'"'
unlockgui
exit 20